package decorator

import "utilx/logx"

// IPizza 零件接口
type IPizza interface {
	getPrice() int
}

// veggieMania.go: 具体零件

type VeggieMania struct {
}

func (p *VeggieMania) getPrice() int {
	logx.Warn("VeggieMania:Price 10")
	return 10
}

//具体装饰

type TomatoTopping struct {
	pizza IPizza
}

func (c *TomatoTopping) getPrice() int {
	logx.Debug("Tomato:Price +7")

	return c.pizza.getPrice() + 7
}

// 具体装饰
type CheeseTopping struct {
	pizza IPizza
}

func (c *CheeseTopping) getPrice() int {
	logx.Debug("Cheese:Price +10")
	return c.pizza.getPrice() + 10
}
